const echarts1 = document.querySelector('.echarts-left');
const echarts2 = document.querySelector('.echarts-right');


let eleft = echarts.init(echarts1);
    eleft.setOption({
        title: {
            text: '每月收入',
            left: '15',
        },
        xAxis: {
            data: ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'],
            splitLine: {
                show: true
            }
        },
        yAxis: {
            splitLine: {
                show: true
            }
        },
        series: [
            {
                name: '当前每月收入',
                type: 'bar',
                data: [2600, 1600, 1700, 3300, 4300, 3500, 1700,2500,2200,1800,3850,1800],
                symbolSize: 5,
                symbol: 'circle',
                smooth: true,
                itemStyle: {
                    normal: {
                        color: 'blue',
                        lineStyle: { width: 2 },
                        shadowBlur: 5,
                        shadowColor: '#188df0'
                    }
                }
            },
            {
                name: '同期每月收入',
                type: 'bar',
                data: [2100, 1650, 1800, 3000, 4000, 3700, 1800,2000,2800,2100,3750,3700],
                symbolSize: 5,
                symbol: 'circle',
                smooth: true,
                itemStyle: {
                    normal: {
                        color: 'skyblue',
                        lineStyle: { width: 2 },
                        shadowBlur: 5,
                        shadowColor: '#188df0'
                    }
                }
            }
        ],
        legend: {
            top: 25,
            right: 'center',
        },

    });


    let eright = echarts.init(echarts2);
    eright.setOption({
        title: {
            text: '每年收入走势',
            left: '15',
        },
        xAxis: {
            data: ['2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016', '2017', '2018', '2019', '2020'],
            splitLine: {
                show: true
            }
        },
        yAxis: {
            splitLine: {
                show: true
            }
        },
        series: [
            {
                name: '每年收入走势',
                type: 'line',
                data: [50, 55, 60, 40, 45, 40, 65,40,68,20,73,60],
                symbolSize: 5,
                symbol: 'circle',
                smooth: true,
                itemStyle: {
                    normal: {
                        color: 'yellowgreen',
                        lineStyle: { width: 2 },
                        shadowBlur: 5,
                        shadowColor: '#188df0'
                    }
                }
            },
            {
                name: '每年同期收入走势',
                type: 'line',
                data: [47, 50, 52, 48, 40, 35, 65,45,58,30,73,56],
                symbolSize: 5,
                symbol: 'circle',
                smooth: true,
                itemStyle: {
                    normal: {
                        color: '#ccc',
                        lineStyle: { width: 2 },
                        shadowBlur: 5,
                        shadowColor: '#188df0'
                    }
                }
            }
        ],
        legend: {
            top: 25,
            right: 'center',
        },

    });